// ColonyAI.cs
//
// Copyright (c) 2008 Mike Strobel
//
// This source code is subject to the terms of the Microsoft Reciprocal License (Ms-RL).
// For details, see <http://www.opensource.org/licenses/ms-rl.html>.
//
// All other rights reserved.

using Supremacy.Economy;
using Supremacy.Game;
using Supremacy.Universe;

namespace Supremacy.AI
{
    public static class ColonyAI
    {
        public static void SelectBuildProject(Colony colony)
        {
            if (!colony.Population.IsMaximized)
            {
                bool willNeedFood = false;
                int netFood = colony.NetFood;
                int projectedPopulation = GetProjectedPopulation(colony, 3);
                var foodModifier = colony.GetProductionModifier(ProductionCategory.Food);
            }
        }

        private static int GetProjectedPopulation(Colony colony, int numberOfTurns)
        {
            var populationCopy = colony.Population.Clone();
            
            populationCopy.UpdateAndReset();

            if (populationCopy.IsMaximized)
                return populationCopy.CurrentValue;

            for (int i = 0; (i < numberOfTurns) && !populationCopy.IsMaximized; i++)
                populationCopy.AdjustCurrent(colony.GrowthRate);

            return populationCopy.CurrentValue;
        }
    }
}